﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpages/Main.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="AllProjectsDetails.aspx.cs" Inherits="User_Shares_AllProjectsDetails" %>

<%@ Register Src="../../Controls/ContentHolder/Holder1.ascx" TagName="Holder1" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">    
    <style type="text/css">
        .style1
        {
            width: 100%;
        }  
           div#container_main.span-24 div#content.span-19 div#ctl00_ContentPlaceHolder1_UpdatePanel1 div div#containerRoundCorner.roundCorner div#contentArea.roundCorner div#printdiv.cent div table#ctl00_ContentPlaceHolder1_Holder11_ctl00_GridViewProjects.tablesorter thead tr th.header
             {
                 padding:10px 20px;
             } 
    </style>
    <script type="text/jscript">
        $("cent").center();
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript">
        function CallPrint(strid) {
            var prtContent = document.getElementById(strid);
            var WinPrint = window.open('', '', 'letf=0,top=0,width=100%,height=100%,toolbar=0,scrollbars=2,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
            //            prtContent.innerHTML = strOldOne;
        }

        $(document).ready(function () {
            $('[id$=GridViewProjects]').tablesorter({
                    headers: { 9: {sorter : false}}
                });
        });
    </script>
<%--    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>--%>
            <asp:LoginView ID="LoginViewSearch" runat="server">
                <RoleGroups>
                    <asp:RoleGroup Roles="admin,bonyadshahrestan,fourthfactor,employer,edituser,viewuser">
                        <ContentTemplate>
                            <div id="adminToolsContainer" style="background-color: #CCCCFF;">
                                <div class="append-7" style="background-color: #CCCCFF; margin: 5px auto; direction: rtl;
                                    text-align: right;">
                                    <asp:CheckBox ID="CheckBoxAdvisor" runat="server" Text="مشاوران" Checked="true" OnCheckedChanged="CheckBox_CheckedChanged"
                                        AutoPostBack="True" />
                                    <asp:CheckBox ID="CheckBoxSurveyor" runat="server" Text="نقشه برداران" Checked="true"
                                        OnCheckedChanged="CheckBox_CheckedChanged" AutoPostBack="True" />
                                </div>
                                <br />
                                <div id="sort">
                                    <asp:DropDownList ID="DropDownListSort" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownChanged">
                                        <asp:ListItem Selected="True" Text="روستا" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="نام مشاور یا نقشه بردار" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="شماره قرارداد" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="شهرستان" Value="3"></asp:ListItem>
                                    </asp:DropDownList>
                                    <br />
                                    <asp:RadioButton ID="RadioButtonAsc" runat="server" Text="افزایشی" GroupName="sort"
                                        AutoPostBack="True" Checked="true" OnCheckedChanged="RadioButton_CheckedChanged" />
                                    <br />
                                    <asp:RadioButton ID="RadioButtonDec" runat="server" Text="کاهشی" GroupName="sort"
                                        AutoPostBack="True" OnCheckedChanged="RadioButton_CheckedChanged" />
                                </div>
                            </div>
                        </ContentTemplate>
                    </asp:RoleGroup>
                    <asp:RoleGroup Roles="Surveyor,advisor">
                    </asp:RoleGroup>
                </RoleGroups>
            </asp:LoginView>
            <br />
            <uc1:Holder1 ID="Holder11" runat="server" Title="دریافت مدارک">
                <ContentTemplate>
                    <div id="printdiv" style="margin: auto;" class="cent">
                        <asp:GridView ID="GridViewProjects" runat="server" AutoGenerateColumns="False" EnableModelValidation="false"
                            EnableViewState="false" CssClass="tablesorter" BackColor="#CCCCFF" OnPreRender="GridViewProjects_PreRender"
                            OnRowDataBound="GridViewProjects_RowDataBound" FooterStyle-BackColor="#3399FF">
                            <AlternatingRowStyle BackColor="#DDD9FF" />
                            <Columns>
                                <asp:BoundField DataField="AdvisorFullName" HeaderText="نام مشاور" />
                                <asp:BoundField DataField="City" HeaderText="نام شهرستان" />
                                <asp:BoundField DataField="Bakhsh" HeaderText="نام بخش" />
                                <asp:BoundField DataField="Dehestan" HeaderText="نام دهستان" />
                                <asp:BoundField DataField="VillageName" HeaderText="نام روستا" />
                                <asp:BoundField DataField="ContractDate" HeaderText="تاریخ قرارداد"  />
                                <asp:BoundField DataField="ContractNumber" HeaderText="شماره قرارداد" ItemStyle-Font-Bold="true"
                                    ItemStyle-ForeColor="Black" />
                                <%-- <asp:TemplateField HeaderText="پیشرفت">
                            <ItemTemplate>
                                <asp:Label ID="LabelProgress" runat="server" Text='<%# Eval( "Progress" ) + " %" %>'
                                    Style="clear: both; display: inline;"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                                <asp:BoundField DataField="ContractTypeText" HeaderText="نوع  قرارداد" />
                                <asp:TemplateField HeaderText="دیرکرد (روز)">
                                    <ItemTemplate>
                                        <asp:Label ID="LabelDelay" runat="server" Text='<%# Eval( "Delay" ) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="ButtonSeeMore" runat="server" CommandArgument='<%# Eval( "ContractId" ) %>'
                                            CommandName="ContractId" OnClick="ButtonSeeMore_Click" Text="مشاهده" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#688CF5" ForeColor="#000066" />
                            <PagerStyle BackColor="#688CF5" />

                        </asp:GridView>
                    </div>
                </ContentTemplate>
            </uc1:Holder1>
<%--        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="LoginViewSearch" />
        </Triggers>
    </asp:UpdatePanel>--%>
    <table class="style1">
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="ExportToExcel0" runat="server" Text="ذخیره در فایل Excel" Font-Names="Tahoma"
                    Height="25px" OnClick="ExportToExcel_Click" Width="150px" />
                <input id="Button1" type="button" onclick="CallPrint('printdiv')" style="font-family: Tahoma;"
                    value="پرینت" />
            </td>
        </tr>
    </table>
</asp:Content>
